<template>
	<view>
        <view class="student-details-websocket-msg">
            <view  @click="onClickJump">
                <image mode="scaleToFill" :src="`${imgUrl}/websocket/${
                    newWebsocketMsg.type == 'SIGN_START' ? 'qdao' :
                    newWebsocketMsg.type == 'SELECT_START' ? 'xr' :
                    newWebsocketMsg.type == 'ANSWER_START' ? 'qd' :
                    newWebsocketMsg.type == 'VOTE_START' ? 'tp' :
                    newWebsocketMsg.type == 'DISCUSS_START' && newWebsocketMsg.data.type == 'DISCUSSION_FREE' ? 'tl' :
                    newWebsocketMsg.type == 'DISCUSS_START' && newWebsocketMsg.data.type == 'DISCUSSION_GROUP' ? 'group' :
                    newWebsocketMsg.type == 'GROUP_CREATE' ? 'grouping' :
                    newWebsocketMsg.type == 'TEST_PAPER_RELEASE' ? 'cs' : 
                    newWebsocketMsg.type == 'TEST_QUESTION_RELEASE' ? 'cs' : ''
                }.png`"></image>
                <view>
                    老师发起了{{
                        newWebsocketMsg.type == 'SIGN_START' ? '签到' :
                        newWebsocketMsg.type == 'SELECT_START' ? '选人' :
                        newWebsocketMsg.type == 'ANSWER_START' ? '抢答' :
                        newWebsocketMsg.type == 'VOTE_START' ? '投票' :
                        newWebsocketMsg.type == 'DISCUSS_START' && newWebsocketMsg.data.type == 'DISCUSSION_FREE' ? '讨论' :
                        newWebsocketMsg.type == 'DISCUSS_START' && newWebsocketMsg.data.type == 'DISCUSSION_GROUP' ? '小组讨论' :
                        newWebsocketMsg.type == 'GROUP_CREATE' ? '分组' :
                        newWebsocketMsg.type == 'TEST_PAPER_RELEASE' ? "测试" :
                        newWebsocketMsg.type == 'TEST_QUESTION_RELEASE' ? '测试' :  ''
                    }}活动
                    <span>点击进入>></span>
                </view>
            </view>
            <view  @click="handleClose">
                <image mode="scaleToFill" :src="`${imgUrl}/websocket/close.png`"></image>
            </view>
        </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgUrl:this.$CDNURL.IMGURL
			}
        },
        props:{
			newWebsocketMsg: {
				type: Object,
				default: {}
			}
		},
		methods: {
            onClickJump(){
                this.$emit('jump')
            },
            handleClose(){
                this.$emit('close')
            }
		}
	}
</script>

<style lang="scss" scoped>
    .student-details-websocket-msg{
        width: 750rpx;
        height: 80rpx;
        background: #49D68F;  
        display: flex;
        justify-content: space-between;
        align-items: center; 
    }
    .student-details-websocket-msg >view:nth-child(1){
        flex: 1;
        display: flex;
        align-items: center;
        font-size: 26rpx;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #FFFFFF;
    }

    .student-details-websocket-msg >view:nth-child(1) span{
        font-size: 22rpx;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #FFFFFF;
        margin-left:24rpx;
    }

    .student-details-websocket-msg >view:nth-child(1) image{
        width: 48rpx;
        height: 48rpx;
        margin: 0 16rpx  0  30rpx;
    }
    .student-details-websocket-msg >view:nth-child(2) image{
        width: 48rpx;
        height: 48rpx;
        display: block;
    }

    .student-details-websocket-msg >view:nth-child(2) {
        width: 80rpx;
        height: 80rpx;
        display: flex;
        align-items: center;
    }
</style>
